package hw.hw01;/*
 *@Author: gjh
 *Date: 2025/3/25 11:40
 *Describe:
 */

public class People<T extends Pet> {
    private T pet;

    public People() {
    }
    public People(T pet) {
        this.pet = pet;
    }

    public T getPet() {
        return pet;
    }

    public void setPet(T pet) {
        this.pet = pet;
    }

    @Override
    public String toString() {
        return "People{" +
                "pet=" + pet +
                '}';
    }

    public void shopping(){
        System.out.println(pet.getName()+"正在购物");
        pet.call();
    }

}
